using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class Item : MonoBehaviour
{
    [SerializeField]
    private TextMeshProUGUI level;
    [SerializeField]
    private Image icon;
    [SerializeField]
    private Image bg;
    [SerializeField]
    private Slider slider;
    [SerializeField]
    private TextMeshProUGUI percent;

    public void UpdateInfo(int level, Sprite icon, Color bg, int curPercent, int maxPercent) {
        this.level.text = level.ToString();
        this.icon.sprite = icon;
        this.bg.color = bg;
        this.slider.value = (float)curPercent / (float)maxPercent;
        percent.text = $"{curPercent}/{maxPercent}";
    }
}
